<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>set和map</title>
</head>

<body>
  <script>
  //  Set 
  const s1=new Set([6,5,4,3,2,1])
  const s2=new Set()
  // console.log(s1,s2 instanceof Array)
  // console.log(s1.keys())
  //  console.log(s1.values()) 
  //  console.log(s1.entries())
  //  s1.forEach((item)=>{
  //    console.log(item)
  //  })
  //  for (const item of s1){
  //    console.log(item)
  //  }
  // 展开运算符 转化为数组
  // const arr=[...new Set([6,5,4,3,2,1])]

  const s3=new Set([6,5,4,3,2,1])
  const arr=Array.from(new Set([6,5,4,3,2,1]))
    console.log(arr)//[6, 5, 4, 3, 2, 1]
  </script>
</body>

</html>